<#-- @ftlvariable name="entity" type="com.xci.edu.core.entity.ExerciseQuestion" -->
<#-- @ftlvariable name="index" type="Integer" -->
<#-- @ftlvariable name="size" type="Integer" -->
<#-- @ftlvariable name="isCommit" type="boolean" -->
<#include "/sys/_layout.ftl">
<#include "/foreground/pc/train/eduSimulatorExercise/questionType.ftl">
<#if entity==null >
    <div class="bs-callout bs-callout-warning" style="margin-right: 15px; margin-left: 15px;">
        <h4>暂无考题</h4>
    </div>
<#else>
    <div class="row" style="margin-top: 15px; margin-left: 15px;margin-right: 15px; border: 1px solid #cac8c9; padding: 15px;">
        <div class="col-md-4" style="padding-left: 0">
            <div style="height: 32px; line-height: 32px; color: #ff0000; font-size: 20px;">
                <#if isCommit==true >
                    <text>考试时长：</text><span>90:00</span>
                <#else>
                    <input id="noCommit" type="hidden"/>
                    <text>剩余时间：</text><span id="remainingTime">00:00</span>
                </#if>
            </div>
        </div>
        <div class="col-md-8 text-right" style="padding-right: 0">
            <#if index-1&gt;-1>
                <a class="btn btn-default navQuestion" data-url="/train/simulatorExam/getQuestion?index=${index-1}" style="margin-left: 10px;">
                <span class="fa fa-arrow-left"></span> 上一题
                </a>
            </#if>
            <#if index+1 < size>
                <a class="btn btn-default navQuestion" id="nextQuest" data-url="/train/simulatorExam/getQuestion?index=${index+1}" style="margin-left: 10px;">
                <span class="fa fa-arrow-right"></span> 下一题
                </a>
            </#if>
            <#if !isCommit>
                <a class="btn btn-default" id="pause_quest" style="margin-left: 10px;">
                    <span class="fa fa-pause"></span> 暂停
                </a>
                <a class="btn btn-default" id="commit_quest" data-url="/train/simulatorExam/commit" style="margin-left: 10px;">
                <span class="fa fa-arrow-up"></span> 交卷
                </a>
            </#if>
        </div>
    </div>
    <div class="row" style="margin-top: 15px; margin-left: 15px; margin-right: 15px; border: 1px solid #cac8c9; padding: 10px;">
        <#list questList as quest>
            <#if !isCommit>
                <div class="exam_question_num <@WriteValue value=quest.userSelected!=null  class="bgcolor-info" /> <@WriteValue value=quest_index==index  class="bgcolor-warning" />"  data-value="${quest_index+1}" data-url="/train/simulatorExam/getQuestion?index=${quest_index}">${quest_index+1}</div>
            <#else>
                <div class="exam_question_num <@WriteValue value=quest.userSelected!=null && quest.userResult class="bgcolor-success" /> <@WriteValue value=quest.userSelected!=null && !quest.userResult class="bgcolor-danger"/> <@WriteValue value=quest_index==index class="bgcolor-warning"/>" data-value="${quest_index+1}" data-url="/train/simulatorExam/getQuestion?index=${quest_index}">${quest_index+1}</div>
            </#if>
        </#list>
    </div>
    <div class="row" id="exercise_row" style="margin-top: 15px; margin-left: 15px; margin-right: 15px; border: 1px solid #cac8c9; padding: 20px;">
        <p class="exercise_title">${index+1}、${entity.title}</p>
        <div>
            <ul class="exercise_answer">
                <@questType model=entity/>
            </ul>
        </div>
        <div class="row" style="margin-top: 15px;">
            <div class="col-md-6">
                <#if isCommit>
                    <div id="quest_result">
                        您选择的答案111：<span id="user_result" class="user_result">${entity.userAnswer}</span>
                        <#if entity.userResult==true>
                            <a class="btn btn-success exercise_btn" id="answer_yes" style="width: 120px;">回答正确</a>
                        <#else>
                        <a class="btn btn-danger exercise_btn" id="answer_no" style="width: 150px;">正确答案：${entity.answer}</a>
                        </#if>
                    </div>
                <#else>
                    <div class="<@WriteValue value=!entity.userSelected!=null  class="fxhide"/>" id="quest_result" data-url="/train/simulatorExam/checkQuestion?questionId=${entity.id}">
                        您选择的答案222：<span id="user_result" class="user_result">${entity.userAnswer}</span>
                    </div>
                </#if>
            </div>
            <div class="col-md-6 text-right" style="padding-right: 15px;">
                <#if !isCommit>
                    <@questExamOption model=entity/>
                </#if>
            </div>
        </div>
    </div>
    <input id="currentQuestionUrl" type="hidden" data-url="/train/simulatorExam/getQuestion?index=${index}" />
    <input id="correctAnswer" type="hidden" value="${entity.answer}" />
</#if>